package com.siki.pojo.commonEntity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.siki.pojo.base.BaseUuEntity;
import com.siki.pojo.enumeration.common.AuditStatus;
import com.siki.pojo.enumeration.common.UserRole;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import javax.persistence.*;

/**
 * <p>
 * 基本用户对象
 * </p>
 *
 * @author siki
 * @since 2020-06-06
 */


@Getter
@Setter
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ApiModel("账号基础信息实体")
@Entity
@Table(name = "sys_user")
@TableName(value = "sys_user",resultMap = "com.siki.mapper.CommonMap.userResult")
public class SysUser extends BaseUuEntity {

    /**
     * 基本信息
     */
    private static final long serialVersionUID=1L;

    @ApiModelProperty(value = "真实姓名")
    private String realName;

    @ApiModelProperty(value = "账号")
    private String account;

    @ApiModelProperty(value = "密码")
    private String password;

    @ApiModelProperty(value = "用户身份")
    @Enumerated(EnumType.STRING)
    private UserRole userRole;

    @ApiModelProperty("审核状态")
    @Enumerated(EnumType.STRING)
    private AuditStatus auditStatus;

    @ApiModelProperty("账号审核人姓名")
    private String auditUserName;

    @ApiModelProperty("个人用户身份")
    @OneToOne
    @TableField(exist = false)
    private GeneralUser generalUser;

    @OneToOne
    @ApiModelProperty("企业")
    @TableField(exist = false)
    private Enterprise enterprise;
}
